//package com.lik888.web1.config;
//
//import org.apache.http.HttpHost;
//import org.elasticsearch.client.RestClient;
//import org.elasticsearch.client.RestHighLevelClient;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class ElasticSearchConfig {
//
//    private String host = "192.168.48.128";
//
//    private int port = 9200;
//
//    // 将方法名改为 elasticsearchClient
////    @Bean(destroyMethod = "close")
////    public RestHighLevelClient elasticsearchClient() {
////        System.out.println("创建 Elasticsearch Client, 连接到: " + host + ":" + port);
////        return new RestHighLevelClient(
////                RestClient.builder(
////                        new HttpHost(host, port, "http")
////                )
////        );
////    }
//}